<template>
  <div class="com-box">
    <h1>测试的组件</h1>
    <div>
      <span>测试动态值num:{{num}}</span>
      <el-button type="primary" @click="num++">点击num++</el-button>
    </div>
    <h2>父组件传的值{{tel}}</h2>
  </div>
</template>

<script>
  export default {
    name: "helloCom",
    props: {
      tel: {
        type: Number,
        default: () => 111
      }
    },
    data() {
      return {
        num:1
      }
    },
    watch:{
      num(val){
        this.$emit('valChange',val)
      }
    }
  }
</script>

<style scoped lang="less">
  .com-box {
    width: 800px;
    height: 500px;
    border: 1px solid black;
    margin-top: 40px;
    span{
      margin-right: 20px;
    }
  }
</style>
